import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from '@/router'
import ElementPlus, { ElMessageBox, ElMessage} from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Request from '@/utils/Request'
import Verify from '@/utils/Verify'

//components
import CoverUpload from '@/components/CoverUpload.vue'
import Window from '@/components/Window.vue'
import EditorMarkdown from '@/components/EditorMarkdown.vue'
import EditorHtml from '@/components/EditorHtml.vue'

const app = createApp(App)
app.use(router)
app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.config.globalProperties.Request = Request
app.config.globalProperties.$message = ElMessage
app.config.globalProperties.$messageBox = ElMessageBox
app.config.globalProperties.imageUrl = "/api/file/getImage/"
app.config.globalProperties.Verify = Verify

app.component("CoverUpload", CoverUpload)
app.component("Window",Window)
app.component("EditorMarkdown",EditorMarkdown)
app.component("EditorHtml",EditorHtml)
app.mount('#app')
